<%@page import="org.dhbw.cocktail.UsedIngredient"%>
<%@page import="org.dhbw.cocktail.Cocktail"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/cocktailmixer.css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jCocktailmixer - Cocktail</title>
</head>
<body>
	<div id="wrapper">
		<div id="header">
			<h1>Best&auml;nde verwalten</h1>
		</div>
		<jsp:include page="menu.jsp"></jsp:include>

		<div id="content">
			<c:if test="${ingredient == null}">
				<h2>Zutat ausw&auml;hlen</h2>
				<form action="ingredients.html" method="get">
					<select name="id">
						<c:forEach items="${ingredients}" var="item">
							<option value="${item.id}">${item.name}</option>
						</c:forEach>
					</select> <input type="submit" value="ausw&auml;hlen">
				</form>
				<h2>Zutat erstellen</h2>
				<a href="create_ingredient.html">Neue Zutat erstellen</a>
			</c:if>
			<c:if test="${ingredient != null}">
				<h2>Zutat</h2>
				<div id="ingredient">
					<div id="ingredient_attributes">
						<p>
							<span class="desc_column">Name: </span> <span class="val_column">${ingredient.name}</span>
						</p>
						<p>
						<form action="ingredients.html">
							<input type="hidden" name="id" value="${ingredient.id }">
							Vorhandene Menge: <input name="amount" type="text"
								value="${ingredient.amount}"> ${ingredient.unit } <input
								type="submit" value="&auml;ndern">
						</form>
						</p>
					</div>
					<br>
					<div id="using_cocktails">
						<h3>Cocktails mit dieser Zutat:</h3>
						<ol>
							<c:forEach items="${cocktails}" var="item">
								<li><a href="cocktails.html?id=${item.id}">${item.name}</a>
								</li>
							</c:forEach>
						</ol>
					</div>
				</div>
			</c:if>
		</div>
		<br class="clear-float" />
		<div id="footer">
			<a>Impressum</a>
		</div>
	</div>
</body>
</html>